package com.tourscool.springboot.starter.inquiry.controller;

import com.tourscool.springboot.starter.inquiry.core.RequestMethodItem;
import com.tourscool.springboot.starter.inquiry.service.CollectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author Cedric
 * @date 2020/10/23 20:21
 * @description 服务收集控制器
 */
@Slf4j
@RestController
public class CollectController {

    @Autowired
    private CollectService collectService;

    @PostMapping("/push")
    public Boolean collect(@RequestBody List<RequestMethodItem> requestMappingMethodList) {
        log.info("接收到的数据:" + requestMappingMethodList);
        return collectService.collect(requestMappingMethodList);
    }

}
